package com.anc.elasticsearch.model.elasticsearch.entity;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.List;

/**
 * @author 白起老师
 */
@Document(indexName = "es_test_index",shards = 1,replicas = 1)
public class User implements Serializable {
    @Field(type = FieldType.Keyword)
    private String name;
    @Id
    private Long id;
    private int age;
    private Long productId;
    @Field(type = FieldType.Keyword)
    private String productName;
    @Field(analyzer = "ik_max_word",type = FieldType.Text)
    private String desc;
    @Field(type = FieldType.Nested)
    private List<Score> list;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public Long getProductId() {
        return productId;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public List<Score> getList() {
        return list;
    }

    public void setList(List<Score> list) {
        this.list = list;
    }
}
